package com.java.zhuiyun.api.series_course.controller;

import com.java.zhuiyun.api.recommendedCourse.service.RecommendedCourseService;
import com.java.zhuiyun.api.series_course.model.PcSeriesCourse;
import com.java.zhuiyun.common.response.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName SeriesCourseController
 * @Description TODO PC系列课程
 * @Author WX
 * @Date 2023/8/21 16:22
 **/
@RestController
@RequestMapping("/seriesCourse")
@CrossOrigin
public class SeriesCourseController {
    @Autowired
    private RecommendedCourseService recommendedCourseService;

    /*
    * @Author WX
    * @Description PC系列课程
    * @Date 2023/8/21 16:27
    * @Return
    * @param null
    */
    @RequestMapping("/randonSeriesFour")
    public CommonResult randonSeriesFour(){
        return CommonResult.ok(recommendedCourseService.randonSeriesFour());
    }

    /*
    * @Author WX
    * @Description 首页系列课程查询
    * @Date 2023/8/31 10:25
    * @Return
    * @param pcSeriesCourse
    */
    @RequestMapping("/getSeriesCourseById")
    public CommonResult getSeriesCourseById (@RequestBody PcSeriesCourse pcSeriesCourse) {
        return CommonResult.ok(recommendedCourseService.getSeriesCourseById(pcSeriesCourse));
    }

    /*
    * @Author WX
    * @Description 系列课程综查询总金额
    * @Date 2023/8/31 10:27
    * @Return
    * @param pcSeriesCourse
    */
    @RequestMapping("/getSeriesCoursePrice")
    public CommonResult getSeriesCoursePrice(@RequestBody PcSeriesCourse pcSeriesCourse){
        return CommonResult.ok(recommendedCourseService.getSeriesCoursePrice(pcSeriesCourse));
    }
}
